//
//  TCLYAboutView.m
//  YuErmuYing
//
//  Created by LYang on 16/9/26.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYAboutView.h"
#import "Macros.h"
#import "Masonry.h"

@implementation TCLYAboutView
-(instancetype) initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = bgColor;
        
        UIImageView * imageView = [[UIImageView alloc] init];
        imageView.image = [UIImage imageNamed:@"LYAboutImage"];
        imageView.backgroundColor = bgColor;
        [self addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top).offset(0);
            make.left.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.height.mas_equalTo(80/667.0*screenHeight);
        }];
        self.aboutLabel = [[UILabel alloc] init];
        if (screenHeight >= 667.0) {
            self.aboutLabel.font = [UIFont systemFontOfSize:16];
        }else{
            self.aboutLabel.font = [UIFont systemFontOfSize:12];
        }
        self.aboutLabel.textColor = blackFont;
        self.aboutLabel.text = @"小岛宝妈由海港区小螃蟹计算机软件开发服务部，于2016年创建，通过欠打的大规模集采购优势、丰富的电子商务管理经验和最先进的互联网技术为用户提供最好的优质商品。\n\n小岛宝妈一直以来以诚信作为公司和每位员工的行为准则，以超越客户期望为目标，致力于为客户提供丰富的商品选择，便捷的购物方式和完善的售后服务打造更好的E时代购物体验。";
        
        self.aboutLabel.backgroundColor = [UIColor whiteColor];
        self.aboutLabel.numberOfLines = 0;
        self.aboutLabel.layer.cornerRadius = 5;
        self.aboutLabel.layer.masksToBounds = YES;
        self.aboutLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.aboutLabel];
        [self.aboutLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(imageView.mas_bottom).offset(12);
            make.left.mas_equalTo(self.mas_left).offset(12);
            make.right.mas_equalTo(self.mas_right).offset(-12);
            make.height.mas_equalTo(250/667.0*screenHeight);
        }];
        
        UILabel * serviceLabel = [[UILabel alloc] init];
        serviceLabel.font = [UIFont systemFontOfSize:10];
        serviceLabel.textAlignment = NSTextAlignmentCenter;
        serviceLabel.text = @"服务时间:08:00-17:00";
        serviceLabel.textColor = blackFont;
        [self addSubview:serviceLabel];
        [serviceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.mas_bottom).offset(-100/667.0*screenHeight);
            make.centerX.mas_equalTo(self);
            make.width.mas_equalTo(200/375.0*screenWidth);
            make.height.mas_equalTo(20);
        }];
        
        UILabel * telLabel = [[UILabel alloc] init];
        telLabel.font = [UIFont systemFontOfSize:10];
        telLabel.textAlignment = NSTextAlignmentCenter;
        telLabel.textColor = blackFont;
        telLabel.text = @"电话: 12111111111";
        [self addSubview:telLabel];
        [telLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(serviceLabel.mas_top).offset(-6/667.0*screenHeight);
            make.centerX.mas_equalTo(self);
            make.width.mas_equalTo(200/375.0*screenWidth);
            make.height.mas_equalTo(20);
        }];
        
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.font = [UIFont systemFontOfSize:10];
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        self.nameLabel.textColor = blackFont;
        self.nameLabel.text = @"海港区小螃蟹计算机软件开发服务部";
        [self addSubview:self.nameLabel];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(telLabel.mas_top).offset(-6/667.0*screenHeight);
            make.centerX.mas_equalTo(self);
            make.width.mas_equalTo(200/375.0*screenWidth);
            make.height.mas_equalTo(20);
        }];
        
        self.timeLabel = [[UILabel alloc] init];
        self.timeLabel.font = [UIFont systemFontOfSize:10];
        self.timeLabel.textAlignment = NSTextAlignmentCenter;
        self.timeLabel.textColor = blackFont;
        self.timeLabel.text = @"Copyright@2016-2023";
        [self addSubview:self.timeLabel];
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.nameLabel.mas_top).offset(-6/667.0*screenHeight);
            make.centerX.mas_equalTo(self);
            make.width.mas_equalTo(200/375.0*screenWidth);
            make.height.mas_equalTo(20);
        }];
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
